﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class Control_InsertTicketDetailControl : System.Web.UI.UserControl
{
    ListAndProcessData ws = new ListAndProcessData();
    protected void Page_Load(object sender, EventArgs e)
    {
        //var a = ws.getAllCustomer();
        //var b = ws.getBusCar();
        //foreach (var item in a)
        //{
        //    DropDownListCus.Items.Add(item.FullName);
        //}
        //foreach (var item in b)
        //{

        //    DropDownListBusno.Items.Add(item.BusNo);
        //}
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        bool a = false;
        a = ws.InsertTicketDetail(int.Parse(txtPrice.Text), txtSeatNo.Text, (DropDownListCus.SelectedItem).ToString(), (DropDownListBusno.SelectedItem).ToString());
        if (a == true)
        {
            Response.Redirect("../Admin/ShowBusTicketDetail_Admin.aspx");

        }
        else
        {
            Response.Redirect("Default3.aspx");
        }
    }
    protected void btnreset_Click(object sender, EventArgs e)
    {
        txtPrice.Text = "";
        txtSeatNo.Text = "";
    }
}